home *** CD-ROM | disk | FTP | other *** search
- #pragma once on
- /*
- AETE_da.h
- © Bob Boylan 1996
-
- Revision History
- MacHack 1996 initial creation
- */
- #include "BaseTypes.h"
- #include "Clone_ut.h"
- #include "UAppleEventsMgr.h"
-
- #include <vector.h>
- #include <string>
-
-
-
-
-
- // -----------------------------------------------------------------
- // Elem_da
- //
- class Elem_da
- {
- public:
- // data
- DescType _ID;
-
- // i/o
- friend istream& operator >> (istream &ioStream, Elem_da& outElem);
-
- };
-
- // -----------------------------------------------------------------
- // Prop_da
- //
- class Prop_da
- {
- public:
- Prop_da ( DescType inKind = typeNull )
- {
- _ID = inKind;
- }
- // data
- string _Name;
- DescType _ID;
- DescType _Class;
-
- // i/o
- friend istream& operator >> (istream &ioStream, Prop_da& outProp);
-
- // comparison
- Boolean operator == ( const Prop_da & inOther ) const
- {
- return _ID == inOther._ID ;
- }
-
- };
-
- // -----------------------------------------------------------------
- // Class_da
- //
- class Class_da
- {
- public:
- // data
- string _Name;
- DescType _ID;
- vector<Prop_da> _Props;
- vector<Elem_da> _Elems;
-
- // i/o
- friend istream& operator >> (istream &ioStream, Class_da& outClass);
-
- // comparison
- Boolean operator == ( const Class_da & inOther ) const
- {
- return _ID == inOther._ID ;
- }
- };
-
- // -----------------------------------------------------------------
- // ComparisonOp_da
- //
- class ComparisonOp_da
- {
- public:
- // i/o
- friend istream& operator >> (istream &ioStream, ComparisonOp_da& outComparison);
- };
-
- // -----------------------------------------------------------------
- // EnumValue_da
- //
- class EnumValue_da
- {
- public:
- // data
- string _Name;
- DescType _ID;
-
- // i/o
- friend istream& operator >> (istream &ioStream, EnumValue_da& outEnumValue);
-
- // comparison
- Boolean operator == ( const EnumValue_da & inOther ) const
- {
- return _ID == inOther._ID ;
- }
- Boolean operator < ( const EnumValue_da & inOther ) const
- {
- return _ID < inOther._ID ;
- }
-
- };
- // -----------------------------------------------------------------
- // Enum_da
- //
- class Enum_da
- {
- public:
- // data
- DescType _ID;
- vector<EnumValue_da> _Values;
-
- // i/o
- friend istream& operator >> (istream &ioStream, Enum_da& outEnum);
-
- // comparison
- Boolean operator == ( const Enum_da & inOther ) const
- {
- return _ID == inOther._ID ;
- }
-
- };
- // -----------------------------------------------------------------
- // EventParam_da
- //
- class EventParam_da
- {
- public:
- // data
- string _Name;
-
- // i/o
- friend istream& operator >> (istream &ioStream, EventParam_da& outEventParam);
- };
-
- // -----------------------------------------------------------------
- // Event_da
- //
- class Event_da
- {
- public:
- // data
- string _Name;
- vector<EventParam_da> _Params;
-
- // i/o
- friend istream& operator >> (istream &ioStream, Event_da& outEvent);
-
- };
-
- // -----------------------------------------------------------------
- // Suite_da
- //
- class Suite_da
- {
- public:
- // data
- string _Name;
- vector< Event_da > _Events;
- vector< Class_da > _Classes;
- vector< ComparisonOp_da > _CompOps;
- vector< Enum_da > _Enums;
-
- // i/o
- friend istream& operator >> (istream &ioStream, Suite_da& outSuite);
- };
-
- class AppAEObj_pd; // fwd
-
-
-
-
-
- // --------------------------------------------------------------------------------------
- class AETE_da
- {
- public:
- // ctor,dtor
- AETE_da();
- AETE_da( AppAEObj_pd *inApp );
- virtual ~AETE_da();
-
- // access
- virtual
- vector<Prop_da> GetProperties( const DescType inClassID );
- virtual
- vector<Elem_da> GetElements( const DescType inClassID );
-
- virtual
- string GetEnumName( const DescType inEnumValue );
-
- virtual
- string GetClassName( const DescType inClassID );
-
- // helper class for iterating
- class ClassIterator_ut
- {
- public:
- // ctor
- ClassIterator_ut() : _SuitesP( nil ) {}
- ClassIterator_ut( vector<Suite_da> * inSuites, Boolean inPointToEnd = false );
- // op for comparing
- Boolean operator !=( const ClassIterator_ut & inOther );
-
- // op for pre increment
- ClassIterator_ut operator ++();
-
- // access
- Class_da & operator *();
-
- private:
- // data
- Int_32 _SuiteIndex, _ClassIndex;
- vector<Suite_da> *_SuitesP;
- };
-
- protected:
-
- // manipulation of internal data
- virtual
- Clone_ut<StAEDescriptor> RetrieveFromApp( AppAEObj_pd *inApp );
- virtual
- void IncorpAETE( Handle inAETEHandle );
-
- // data
- vector<Suite_da> _Suites;
- vector<EnumValue_da> _EnumMap;
-
- private:
- // private data
- ClassIterator_ut _LastClass;
- AECoercePtrUPP _EnumHandlerUPP;
- AECoercePtrUPP _BooleanHandlerUPP;
-
- };
-